import json
from flaw_point import FlawPoint

class FlowPointEncoder(json.JSONEncoder):
    def default(self, obj):
        if isinstance(obj, FlawPoint):
           return {"flaw_id": obj.flaw_id, "matrix": obj.point_matrix}
        else:
            return super(FlowPointEncoder, self).default(obj)

